package com.xiaomengkuan.plugin.util;

import com.qcloud.cos.COSClient;
import com.qcloud.cos.ClientConfig;
import com.qcloud.cos.auth.BasicCOSCredentials;
import com.qcloud.cos.auth.COSCredentials;
import com.qcloud.cos.region.Region;
import org.springframework.beans.factory.annotation.Value;

/**
 * @author Faraj Mujey
 * -- Creation Time: 2021-01-27 4:01 下午, File Encoding: utf8 --
 */
public class CosClient {

    @Value("${qcloud.cos.secretId}")
    private String secretId;
    @Value("${qcloud.cos.secretKey}")
    private String secretKey;
    @Value("${qcloud.cos.region}")
    private String region;
    @Value("${qcloud.cos.bucketName}")
    private String bucketName;

    COSCredentials cred = new BasicCOSCredentials(secretId, secretKey);
    Region cosRegion = new Region(region);
    ClientConfig clientConfig = new ClientConfig(cosRegion);
    COSClient cosClient = new COSClient(cred, clientConfig);

}
